import request from "@/utils/requset"
// 登录的接口
export const LoginAdmainHandler = (data:{adminname:string,password:string}) =>{
    return request({
        url:'/admin/login',
        method:'POST',
        data
    })
}
// 修改管理员信息
interface IUpdateAdmin{
    adminname:string,
    role:number,
    checkedKeys:any[]
}
export const UpdateAdmainHandler = (data:IUpdateAdmin) =>{
    return request({
        url:'/admin/update',
        method:'POST',
        data
    })
}
// 删除管理员
export const DeleteAdmainHandler = (data:{adminid:string}) =>{
    return request({
        url:'/admin/delete',
        method:'POST',
        data
    })
}
// 添加管理员
interface IAddAdmin{
    adminname:string,
    password:string
    role:number,
    checkedKeys:any[]
}
export const AddAdmainHandler= (data:IAddAdmin) =>{
    return request({
        url:'/admin/add',
        method:'POST',
        data
    })
}
// 获取管理员列表
export const ListAdmainHandler = () =>{
    return request({
        url:'/admin/list',
    })
}

// 获取管理员详细信息
export const DetailAdmainHandler = (params:{adminname:string}) =>{
    return request({
        url:'/admin/detail',
        params
    })
}
